package cn.linran.feignclient;

import cn.linran.User;
//import cn.linran.feignclient.fallback.UserFeignClientFallback;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

/**
 * 调用User服务的feign客户端
 */
@FeignClient(value = "user-server",fallbackFactory = UserFeignClientFallbackFactory.class) //需要调用的服务的应用名称,指定托底类
public interface UserFeignClient {
    /**
     * 将userController的getById方法复制过来,删掉方法体，public：底层调用UserController的接口
     */
    @GetMapping("/getById/{id}")
    User getById(@PathVariable("id") Long id);

}
